home *** CD-ROM | disk | FTP | other *** search
- Path: surfnet.nl!sun4nl!xs4all!falstaff
- From: falstaff@xs4all.nl (Falstaff)
- Newsgroups: comp.lang.c
- Subject: Re: Please help me
- Date: 14 Mar 1996 15:01:30 GMT
- Organization: XS4ALL, networking for the masses
- Message-ID: <4i9cca$9t5@news.xs4all.nl>
- References: <4i19fa$kvu@badger.wmin.ac.uk> <4i6tnm$j9e@spanky.pls.ov.com>
- NNTP-Posting-Host: xs1.xs4all.nl
- X-Newsreader: NN version 6.5.0 #666 (NOV)
-
- glenn@ov.com (Fletcher.Glenn@ov.com) writes:
-
- >In article kvu@badger.wmin.ac.uk, darec@westminster.ac.uk (Nadarajah Thavaneethan) writes:
- >> Hi there anyone know how to write a C program to read a directory and
- >> then for each filename in the directory use the stat system call to
- >> obtain the i-node and print the infomation in the form of a long listing.
- >>
- >> The program should read the directory name from the keyboard.Then open
- >> the directory. Read each entry in turn and obtain the i-node using stat.
-
- Isn't this covered in one of the last chapters of K&R? open_directory()
- or something like that.
-
- >I-node you say? You must be using UNIX. Why re-invent the wheel?
- >Use "ls -l directory_name".
-
- That should be "ls -i dirname" or maybe "ls -il dirname", otherwise
- you won't get the inode number.
-
- Frank
- --
- The famous GIICM now on line: http://www.xs4all.nl/~falstaff/GIICM.html
- ------------------------------------------------------------------------
- Frank A. Vorstenbosch +31-(70)-355 5241 falstaff@xs4all.nl
-